<?php  include VIEWPATH.'common/head.php';  ?>
    <script type="text/javascript">
        var status = '<?php echo $_GET['status'];?>';
        if(status == '-1'){
            alert('fail:<?php echo $_GET['msg'];?>');
        }
        function del_review(uid){
            if(!confirm("你确定移除吗？")){
                return false;
            }
            var url = "index.php?c=user&m=del_review";
            var param = {"uid":uid};
            common_ajax(url, param, function(data){
                if(data.errorCode == 0) {
                    //表单提交
                    window.location.href=  window.location.href;
                    return true;
                }else{
                    alert(data.errorMsg);
                }
            });
        }
    </script>

    <body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="add-btn" style="float:right;margin-bottom:5px;">
            <div class="modal fade" id="add_review" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
                <div class="modal-dialog" style="width: 60%;"><div class="modal-content"></div></div>
            </div>
        </div>
        <div class="clearfix"></div>
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <a href="index.php?c=user&m=add_review" class="btn btn-danger" data-toggle="modal" data-target="#add_review">添加</a>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <form class="form-horizontal" id="f_form" action="index.php?c=<?php echo $_REQUEST['c'];?>&m=<?php echo $_REQUEST['m'];?>" name="form" method="post">

                            <table class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th></th>
                                    <th>ID</th>
                                    <th>昵称</th>
                                    <th>登录方式</th>
                                    <th>性别</th>
                                    <th>手机号</th>
                                    <th>注册日期</th>
                                    <th>用户类别</th>
                                    <th></th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php
                                $loginType = array(1=>"手机号", 2=>"QQ", 3=>"微信", 4=>"微博");$sexArr = array(0=>"默认", 1=>"男", 2=>"女");
                                $userType = array(1=>"注册用户", 2=>"机器人", 3=>"数据导入");
                                foreach($userList as $user) { ?>
                                    <tr>
                                        <th scope="row">
                                            <input type="checkbox" name="uid[]" value="<?php echo $user['uid']; ?>" class="checkbox ck" />
                                        </th>
                                        <td><?php echo $user['uid']; ?></td>
                                        <td nowrap="nowrap" title="<?php echo $user['nickname'];?>">
                                            <a  class="J_menuItem" data-names="用户详情"  href="index.php?c=user&m=user_info&&uid=<?php echo $user["uid"]; ?>&op=user_info" target="_blank">
                                                <?php echo mb_substr($user['nickname'],0, 10, "UTF-8")."..."; ?>
                                            </a>
                                        </td>
                                        <td nowrap="nowrap"><?php echo $loginType[$user['login_type']]; ?></td>
                                        <td nowrap="nowrap"><?php echo $sexArr[$user['sex']]; ?></td>
                                        <td nowrap="nowrap"><?php echo $user['mobile']; ?></td>
                                        <td><?php echo !empty($user['regdate']) ? date("Y-m-d H:i", $user['regdate']) : ""; ?></td>
                                        <td><?php echo $userType[$user['user_type']]; ?></td>
                                        <td nowrap="nowrap">
                                            <a href="javascript:void(0)" onclick="del_review(<?php echo $user['uid']; ?>)">移除</a>
                                        </td>
                                    </tr>
                                <?php }?>
                                </tbody>
                            </table>
                            <div class="set_page">
                                <?php echo $multipage;?>
                                <div class="set_del">
                                    <label class="l_c_sel">
                                        <input type="checkbox" name="chkall" onclick="checkAll('prefix', this.form, 'uid')" class="checkbox c_sel" style="float: left;margin: 0px;display: inline;"/>全选
                                    </label>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>

    </div>


<?php  include VIEWPATH.'common/footer.php';  ?>